<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
this template is for theme ['tinyBlue', 'tinyRed', 'retroGettysburg']
-->
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <%= stylesheet_link_tag '/stylesheets/theme/style.css', "will_paginate", "scaffold", :media => "all" %>
    <%= auto_discovery_link_tag(:rss, {:action => :feed}) %>     
    <title><%= "#{@blog.title} | #{@blog.subtitle}" %></title>     
    <script type="text/javascript">   
function doSearch() {           
    var keywords = document.getElementById("keywords").value;           
    if (keywords=='') {                   
        document.getElementById("keywords").focus();
        return false;           
    } else {    
        return true;
    }   
}    
function onchange(o,a,aa){
    if (o.style.display=='none') { 
        o.style.display='block'; 
        a.innerText='[hide]';
        aa.innerText='[hide]';
    } else {
        o.style.display='none'; 
        a.innerText='[show]';
        aa.innerText='[show]';
    }   
}    
function c(x) {   
    //	y = "img"+x          
    if (document.getElementById(x).style.display == "") {
        document.getElementById(x).style.display = "none"
        //document.getElementById(y).src = "/image/page/open.g}
    } else {                   
        document.getElementById(x).style.display = ""                   
        //document.getElementById(y).src = "/image/page/close.gif"          
    }   
}    
function onChange(oid,aid,aaid){     
    if (document.getElementById(oid).style.display == 'none') {       
        document.getElementById(oid).style.display = 'block';             
        document.getElementById(aid).innerText = '[hide]';           
        document.getElementById(aaid).innerText = '[hide]';      
    } else {       
        document.getElementById(oid).style.display = 'none';           
        document.getElementById(aid).innerText = '[show]';           
        document.getElementById(aaid).innerText = '[show]';     
    }   
}      
</script>   
  </head>   
  <body>     
    <div id="container">
      <div id="banner">         
        <h1><%= link_to @blog.title, {:action => "index", :id => nil} %></h1>         
        <h2><%= @blog.subtitle %></h2>       
      </div>
      
      <div id="center">
        <div class="content">
          <%= yield :layout %>
        </div><!-- end content -->
      </div><!-- end center -->
     
      <div id="right">
        <div class="sidebar">
          <div class="block">
            <h2 onclick="c('about')">About</h2>
            <div id="about">
              <%= @blog.about %>
            </div>
          </div>
          
          <div class="block">
            <h2 onclick="c('category')">Category</h2>
            <div id="category">
              <ul>                 
                <% for category in @blog.categories %>
                  <li><%= link_to "#{category.name} (#{category.entries_count})", {:action => "category", :id => category.id} %></li>
                <% end %>
              </ul>             
            </div>         
          </div>
          
          <div class="block">
            <h2 onclick="c('tag')">Tag Cloud</h2>
            <div id="tag">
              <% tag_cloud @blog.entries.tag_counts, %w(css1 css2 css3 css4) do |tag, css_class| %>                 
                <%= link_to tag.name, { :action => "tag", :id => tag.name }, :class => css_class %>               
              <% end %>      
            </div>        
          </div>
          
          <div class="block">
            <h2 onclick="c('recententry')">Latest</h2> 
            <div id="recententry">
              <ul>
                <% for entry in @blog.latest_entries(@blog.recent_entries) %>                   
                  <li><%= link_to entry.title, {:action => :show, :id => entry.id } %></li>                 
                <% end %> 
              </ul>             
            </div>           
          </div>	                        
          
          <div class="block">             
            <h2 onclick="c('recentfeedback')">Comment</h2>  
            <div id="recentfeedback">
              <ul>
                <% for comment in @blog.latest_comments(@blog.recent_comments) %>         
                  <li><%= link_to comment.name, comment.website %> on <%= link_to truncate(comment.commentable.title, 30, "..."), {:action => :show, :id => comment.commentable_id, :anchor => "comment-#{comment.id}"} %></li>
                <% end %>
              </ul>
            </div>  
          </div>        
          
          <div class="block">    
            <h2 onclick="c('link')">Blogroll</h2>
            <div id="link">  
              <ul>      
                <% for link in @blog.links %>   
                  <li><%= link_to link.name, link.url %></li>
                <% end %>    
              </ul>
            </div>  
          </div>         
          
          <div class="block">
            <h2 onclick="c('archive')">Archive</h2>  
            <div id="archive">     
              <ul>    
                <% for entry in @blog.latest_archive_links %>                   
                  <li><%= link_to "#{entry[:year]}/#{entry[:month]}", {:action => :archive, :year => entry[:year], :month => entry[:month]} %></li>                 
                <% end %>  
              </ul>     
            </div>
          </div>                      
          
          <% for block in @blog.visible_blocks %>
            <div class="block">
              <h2><%= block.name %></h2>
              <div><%= block.content %></div>
            </div>
          <% end %>
                    
          <%= @blog.custom %>
                    
          <div class="block">
            <h2 onclick="c('meta')">Meta</h2>
            <div id="meta">
              <ul>
                <li><%= link_to "Login", {:controller => :user, :action => :login} %></li>
                <li><%= link_to 'Entries <abbr title="Really Simple Syndication">RSS</abbr>', {:action => :feed}, {:title => "Syndicate this site using RSS 2.0"} %></li>
                <li><%= image_tag("Eros_beta.jpg") %></li>
                <li><%= image_tag("rails.png") %></li>
              </ul>
            <!--<a href="http://feedvalidator.org/check.cgi?url=http%3A//202.113.182.175%3A8080/space/feed.do%3Fmethod%3Drss2%26uid%3D${user.id}" target="_blank"><img src="<html:rewrite page='/image/page/valid-rss.png'/>" alt="[Valid RSS]" title="Validate my RSS feed" /></a>--></div>
          </div><!-- end powered -->
        </div><!-- end sidebar -->
      </div><!-- end right -->
      <div style="clear:both;">&nbsp;</div>
      <div id="footer" style="text-align:center;">
        <div id="innerFooter">Powered by
          <%= link_to "Eros-Blog system rails version 0.1 beta", :action => :index, :id => nil %>
          &copy; 2007 ,skin tinyblue by <a href="http://blog.terac.com/andy/"
                                         target="_blank">Andy</a></div>
      </div>
    </div><!-- end container -->
  </body>
</html>